import 'dart:ui';

import 'package:flutter/material.dart';

class GaussianBlurUtils {
  GaussianBlurUtils._();

  static ClipRect blur({
    Color color = const Color(0x4D000000),
    double sigmaX = 5.0,
    double sigmaY = 5.0,
    double opacity = 0.5,
  }) {
    return ClipRect(
      child: BackdropFilter(
        filter: ImageFilter.blur(sigmaX: sigmaX, sigmaY: sigmaY),
        child: Opacity(
          opacity: opacity,
          child: Container(
            alignment: Alignment.center,
            height: double.infinity,
            width: double.infinity,
            decoration: BoxDecoration(
              color: color,
            ),
          ),
        ),
      ),
    );
  }
}
